<script type="text/javascript" src="../media/system/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../media/system/js/jQuery.vietvang.validate.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$('#adminForm').validate({
			});
		});
</script>

<form action="index.php?option=com_certification" method="post" id="adminForm" name="adminForm" class="adminform">

          
           <table border=0 id="table-create-coach" style="width:720px">
            <tr style="visibility:hidden">
                <td style="min-width:200px"></td>
                <td style="width:220px"></td>
                <td style="width:300px"></td>
            </tr>
            <tr>
                <td></td>
                <td class="err">※印は入力必須項目です。</td>
            </tr>
           <tr>
                <td><label class="float-right">指導者資格コード</label></td>
                <td colspan="4"><input type="text" value="<?php echo $this->row->COLI_CODE; ?>" readonly="true" class="readonly inputbox medium" id="jformCOLI_CODE" name="jform[COLI_CODE]" /></td>
                
            </tr>

            <tr>
                <td><label class="float-right">指導員名<span class='err'>※</span></label></td>
                <td><input style="float:left" type="text" value="<?php echo $this->row->COLI_COCH_CODE; ?>" readonly="true" id="jformCOLI_COCH_CODE" name="jform[COLI_COCH_CODE]" class="inputbox medium" />
                <button style="float:left" type="button" name="btnCOLI_COCH_CODE"  id="btnCOLI_COCH_CODE" class="btn">検索</button>
            </td>
                <td>
                     
                </td>
            </tr>
            <tr>
                <td><label class="float-right">指導者種別</label></td>
                <td>
                    <select id="jformCOLI_COCM_CODE" name="jform[COLI_COCM_CODE]" class="medium">
                    <?php
                        foreach($this->list_cocm as $value){
                            
                    ?>
                        <option value="<?php echo $value->COCM_CODE; ?>" <?php if($this->row->COLI_COCM_CODE == $value->COCM_CODE){ echo 'selected="selected"'; } ?> ><?php echo $value->COCM_NAME; ?></option>
                    <?php
                        }
                    ?>
                    </select>
                </td>
                
            </tr>
            <tr>
                <td><label class="float-right">指導者研修区分</label></td>
                 <td colspan="2">
                    <input style="float:left" name="jform[COLI_COTF]" type="radio" value="0" class="rd" id="rd1" <?php if($this->row->COLI_COTF == 0){ echo 'checked="checked"'; } ?> />
                    <label for="rd1" style="width: 50;line-height: 25px;float:left;margin-right:10px">財団職員による養成</label>
                    <input style="float:left" name="jform[COLI_COTF]" type="radio" value="1" class="rd" id="rd2" <?php if($this->row->COLI_COTF == 1){ echo 'checked="checked"'; } ?> />
                    <label for="rd2" style="width: 50;line-height: 25px;float:left">地域センターによる養成</label>
                </td>
               
            </tr>
             <tr>
                <td><label class="float-right">研修場所<span class='err'>※</span></label></td>
                <td><input style="float:left" type="text" value="<?php echo $this->row->COLI_OCBA_CODE; ?>" readonly="true" name="jform[COLI_OCBA_CODE]" id="jformCOLI_OCBA_CODE" class="inputbox medium" />
                <button style="float:left" type="button" name="btnCOLI_OCBA_CODE" id="btnCOLI_OCBA_CODE" class="btn">検索</button></td>

                <td> </td>
            </tr>
             <tr  style="vertical-align:top;line-height:30px">
                <td><label class="float-right">研修回<span class='err'>※</span></label></td>
                <td colspan="2">
                    <input type="text" data_required="true" vvName="number" value="<?php echo $this->row->COLI_TERM; ?>" name="jform[COLI_TERM]" id="jformCOLI_TERM" class="inputbox medium" />
                    <input name="jform[COLI_UNIT]" type="radio" value="1" class="rd" id="rd_time1" <?php if($this->row->COLI_UNIT == 1){ echo 'checked="checked"'; } ?> /><label for="rd_time1" class="rd">回</label>
                    <input name="jform[COLI_UNIT]" type="radio" value="2" class="rd" id="rd_time2" <?php if($this->row->COLI_UNIT == 2){ echo 'checked="checked"'; } ?> /><label for="rd_time2" class="rd">期</label>
                    <input name="jform[COLI_UNIT]" type="radio" value="3" class="rd" id="rd_time3" <?php if($this->row->COLI_UNIT == 3){ echo 'checked="checked"'; } ?> /><label for="rd_time3" class="rd">年度</label>
                    <span name="msg_error"></span>
                </td>
            </tr>
            <tr>
                <td><label class="float-right">判定日</label></td>
                <td>
                    <?php if($this->row->COLI_JDATE != 0){ $dt = date('Y-m-d',strtotime($this->row->COLI_JDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[COLI_JDATE]', 'jformCOLI_JDATE');?><!--<input type="text" class="inputbox medium" name="jform[COLI_JDATE]" id="jformCOLI_JDATE" />-->
                    <span name="msg_error"></span>
                </td>
            </tr>
            <tr>
                <td><label class="float-right">旧資格</label></td>
                <td>
                   <input name="jform[COLI_OLDF]" type="radio" value="1" class="rd" id="rd_td1" <?php if($this->row->COLI_OLDF == 1){ echo 'checked="checked"'; } ?> /> <label for="rd_td1" class="rd">あり</label>
                   <input name="jform[COLI_OLDF]" type="radio" value="0" class="rd" id="rd_td2" <?php if($this->row->COLI_OLDF == 0){ echo 'checked="checked"'; } ?> /> <label for="rd_td2" class="rd">なし</label>
                </td>
                <td>
                   <!--<input name="jform[COLI_OLDF]" type="radio" value="0" class="rd" id="rd_td2" </?php if($this->row->COLI_OLDF == 0){ echo 'checked="checked"'; } ?> /> <label for="rd_td2" class="rd">なし</label>-->
                </td>
            </tr>
            <tr>
                <td><label class="float-right">備考</label></td>
                <td colspan="2">
                    <textarea name="jform[COLI_NOTE]" id="jformCOLI_NOTE" rows="4" cols="50"><?php echo $this->row->COLI_NOTE; ?></textarea>
                </td>
            </tr>
           
           
            </table>

   
	<div>
		<input type="hidden" name="task" value="" />
	
</form>
<script>
    jq(document).ready(function() {
        var zb;
        //show a dialog box: COCH search
        jq('#btnCOLI_COCH_CODE').bind('click', function(e) {
            e.preventDefault();
            zb = new jq.Zebra_Dialog('', {
                source:  {'ajax': 'index.php?option=com_certification&views=bg&task=popup_coch&tmpl=component'},
                height: 800,
                width: 550,
                title:  '指導者検索',
                type:  '',
                buttons:  [
                    {caption: '閉じる', callback: function() { }},
                        
                ]
                               
            });
        }); 
        
        
        jq(".link_coch_code").live("click",function(){
            var id = jq(this).html();
            jq("#jformCOLI_COCH_CODE").val(id);
            zb.close();
        });
        
        
        //show a dialog box: OCBA search
        jq('#btnCOLI_OCBA_CODE').bind('click', function(e) {
            e.preventDefault();
            zb = new jq.Zebra_Dialog('', {
                source:  {'ajax': 'index.php?option=com_certification&views=bg&task=popup_ocba&tmpl=component'},
                height: 800,
                width: 550,
                title:  'センター・クラブ検索',
                type:  '',
                buttons:  [
                    {caption: '閉じる', callback: function() { }},
                        
                ]
                               
            });
        }); 
        
        
        jq(".link_ocba_code").live("click",function(){
            var id = jq(this).html();
            jq("#jformCOLI_OCBA_CODE").val(id);
            zb.close();
        });
        
    });
    //calendar
    window.addEvent('domready', function() {Calendar.setup({
    	// Id of the input field
    	inputField: "jformCOLI_JDATE",
    	// Format of the input field
    	ifFormat: "%Y/%m/%d",
    	// Trigger for the calendar (button ID)
    	button: "jformCOLI_JDATE",
    	// Alignment (defaults to "Bl")
    	align: "Bl",
    	singleClick: true,
    	firstDay: 0
	   });
    });
</script>